@echo off
echo 正在配置 Electron Builder 镜像源...
echo.

echo 可用的 GitHub 镜像源：
echo 1. ghproxy.com (推荐)
echo 2. mirror.ghproxy.com
echo 3. gh.api.99988866.xyz
echo 4. 跳过代码签名工具下载
echo.

set /p choice=请选择镜像源 (1-4, 默认为1): 

if "%choice%"=="" set choice=1
if "%choice%"=="1" (
    set ELECTRON_BUILDER_BINARIES_MIRROR=https://ghproxy.com/https://github.com/electron-userland/electron-builder-binaries/releases/download/
    echo 已选择 ghproxy.com 镜像
)
if "%choice%"=="2" (
    set ELECTRON_BUILDER_BINARIES_MIRROR=https://mirror.ghproxy.com/https://github.com/electron-userland/electron-builder-binaries/releases/download/
    echo 已选择 mirror.ghproxy.com 镜像
)
if "%choice%"=="3" (
    set ELECTRON_BUILDER_BINARIES_MIRROR=https://gh.api.99988866.xyz/https://github.com/electron-userland/electron-builder-binaries/releases/download/
    echo 已选择 gh.api.99988866.xyz 镜像
)
if "%choice%"=="4" (
    set ELECTRON_BUILDER_ALLOW_UNRESOLVED_DEPENDENCIES=true
    set WIN_CSC_LINK=
    echo 已配置跳过代码签名工具
)

set ELECTRON_BUILDER_CACHE=%USERPROFILE%\.electron-builder-cache
set ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/
set ELECTRON_CACHE=%USERPROFILE%\.electron-cache

echo.
echo 当前配置：
echo ELECTRON_BUILDER_BINARIES_MIRROR=%ELECTRON_BUILDER_BINARIES_MIRROR%
echo ELECTRON_BUILDER_CACHE=%ELECTRON_BUILDER_CACHE%
echo ELECTRON_MIRROR=%ELECTRON_MIRROR%
echo ELECTRON_CACHE=%ELECTRON_CACHE%
echo.
echo 配置完成！现在可以运行构建命令了。
pause